package day06;

public class P05ExceptionApp {

    public static void main(String[] args) {
        System.out.println("\u0070\u0031\u0030");
        System.out.println(isNumeric("+14.35"));
        System.out.println(isNumeric("+14.35111"));
        System.out.println(isNumeric("-14.35e12"));
        System.out.println(isNumeric("123"));
        System.out.println(isNumeric("abc"));
        // Double.parseDouble("11afdasf");
    }

    private static boolean isNumeric(String s) {//谓词函数
        try {
            Double.parseDouble(s);
            return true;
        } catch (NumberFormatException e) {
            return false;
        }

    }
}
